#include<stdio.h>
#define maxsize 100
struct list
{int elem[maxsize];
int length;
};

int del(struct list *L,int i)
   {int j;
     if(i<1||i>L->length)
         return 0;
     for(j=i;j<=L->length-1;j++)
        L->elem[j]=L->elem[j+1];
     L->length--;
     return 1;}


main()
{
struct list l1;
int i,j;
printf("input length:\n");
scanf("%d",&l1.length);
printf("input data:\n");
for(i=1;i<=l1.length;i++)
scanf("%d",&l1.elem[i]);

for(i=1;i<=l1.length;i++)
printf("%d ",l1.elem[i]);
printf("\n");
printf("input j:\n");
scanf("%d",&j);

i=del(&l1,j);
if(i==0)printf("error!");
else printf("ok!");

for(i=1;i<=l1.length;i++)
printf("%d ",l1.elem[i]);
}
